# -*- coding = utf-8 -*-
# @Time : 2023/6/2 16:56
# @Author : 龙王赘婿_彪少
# @File : print_hex.py
# @Software: PyCharm

# 功能：


if __name__ == "__main__":
    data = 20
    print("data = %x" % data)
    print("data = %02x" % data)  # 和上面不同的是 上面显示 1 下面显示 01 会补0
    print("data = %#x" % data)
    print(f"data = {data:#x}")
    print("data = {}".format(data))
    print("data = {:#x}".format(data))

    a_list = range(4)
    print('[{}]'.format(', '.join(hex(x) for x in a_list)))
